package com.atguigu;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/servlet1")
public class servlet1 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("请求已经发送到servlet1");
//        resp.sendRedirect("servlet2");
//        resp.sendRedirect("1.html");
//        resp.sendRedirect("WEB-INF/2.html");
          resp.sendRedirect("https://www.atguigu.com");
    }
}
